<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta name="baidu-site-verification" content="nPxypLjNNn" />
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>抢救一下，还能战斗</title>

 <link rel="stylesheet" type="text/css" href="../static/css/style.css">
<link rel="stylesheet" type="text/css" href="../static/css/index.css">

<style type="text/css">
    #movie_rank
        {
            height: 260px;
        }
        .box2
        {
            border: 1px solid #ADDFF2;
            text-align: left;
            overflow: hidden;
            color: #9C9C9C;
            text-align: left;
        }
        .box2
        {
            margin-bottom: 7px;
        }
        .box2 h2
        {
            background: #EEF7FE;
            height: 21px;
            line-height: 21px;
            overflow-y: hidden;
            border-bottom: 1px solid #ADDFF2;
            color: #1974C8;
            font-size: 12px;
            padding: 0px 8px;
        }
        .box2 h2 a.more
        {
            float: right;
            text-decoration: underline;
            background: url() no-repeat 100% -123px;
            padding-right: 8px;
            font-weight: normal;
        }
        .box2 h2 span
        {
            margin-left: 5px;
            font-weight: normal;
            color: #B9B7B8;
        }
        .box2 .inner
        {
            padding: 8px;
            line-height: 18px;
            overflow: hidden;
            color: #3083C7;
        }
        .box2 a
        {
            color: #3083C7;
            white-space: nowrap;
        }
        .rank_list
        {
            line-height: 14px;
            margin: auto;
            padding-top: 5px;
        }
        .rank_list li
        {
            height: 14px;
            margin-bottom: 8px;
            width: 290px;
            padding-left: 20px;
            white-space: nowrap;
            overflow: hidden;
            position: relative;
        }
        .rank_list li.top3 em
        {
            background: #FFE4B7;
            border: 1px solid #FFBB8B;
            color: #FF6800;
        }
        .rank_list em
        {
            position: absolute;
            left: 0;
            top: 0;
            width: 12px;
            height: 12px;
            border: 1px solid #B1E0F4;
            color: #6298CC;
            font-style: normal;
            font-size: 10px;
            font-family: Arial;
            background: #E6F0FD;
            text-align: center;
            line-height: 12px;
            overflow: hidden;
        }
        .rank_list span
        {
            position: absolute;
            width: 60px;
            color: #B7B7B7;
            text-align: right;
            height: 14px;
            background: #fff;
            left: 110px;
        }
        #movie_rank .rank_list span
        {
            position: absolute;
            width: 40px;
            color: #B7B7B7;
            text-align: right;
            height: 14px;
            background: #fff;
            left: 260px;
        }
</style>



</head>
<body>
<div id="container">
	<div id="bd">
        <div id="main">
        	<h1 class="title">
            	<a href="http://cec.jmu.edu.cn/"><div class="logo large"></div></a>
            </h1>
            <div class="nav ue-clear">
            	<ul class="searchList">
					<li class="searchItem current" data-type="it">计算机工程学院</li>
                    <li class="searchItem" data-type="marine">轮机工程学院</li>
                    <li class="searchItem" data-type="_all">所有学院</li>
                </ul>
            </div>
            <div class="inputArea">
            	<input type="text" class="searchInput" />
                <input type="button" class="searchButton" onclick="add_search()" />
                <ul class="dataList">
                	<li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>

           <div style="margin:0 auto;width:485px;">
				<label style="font-size: 14px;color:black; ">会议通知：</label>
				<span class="all-search">
					<a href="http://cec.jmu.edu.cn/info/1067/7298.htm">计算机工程学院2018-2019学年上学期第十五周会议安排表 </a>
				</span>
			</div>
			<div class="historyArea">
				<br>
			</div>

            <div class="historyArea">
           
                <p class="history mysearch">
                	<label style="font-size: 14px;color:black; ">我的搜索：</label>
                    <span class="all-search">
                        <a href="javascript:;"></a>
                        <a href="javascript:;"></a>
                        <a href="javascript:;"></a>
                        <a href="javascript:;"></a>
                    </span>

                </p>
            </div>
        </div><!-- End of main -->
    </div><!--End of bd-->



    <div  class="historyArea">
       <div class="box2" id="movie_rank">
        <h2>
            <a href="#" class="more">更多</a>源码排行</h2>
        <div class="inner">
            <ul class="rank_list">
                <li class="top3"><em>1</em><a href="#">aaaaaaaaaaaaaaaaaaaaaaaa</a></li>
                <li class="top3"><em>2</em><a href="#">aaaaaaaaaaaaaaaaaaaaaaaa</a></li>
                <li class="top3"><em>3</em><a href="#">aaaaaaaaaaaaaaaaaaaaaaaa</a></li>
                <li><em>4</em><a href="#">ssssssssssssssssss</a></li>
                <li><em>5</em><a href="#">ssssssssssssssssss</a></li>
                <li><em>6</em><a href="#">ssssssssssssssssss</a></li>
                <li><em>7</em><a href="#">ssssssssssssssssss</a></li>
                <li><em>8</em><a href="#">ssssssssssssssssss</a></li>
                <li><em>9</em><a href="#">ssssssssssssssssss</a></li>
                <li><em>10</em><a href="#">ssssssssssssssssss</a></li>
            </ul>
        </div>
    </div>
   </div>











    <div class="foot">
    	
    </div>
</div>
</body>

<script type="text/javascript" src="../static/js/jquery.js"></script>
<script type="text/javascript" src="../static/js/global.js"></script>
<script type="text/javascript">
    var suggest_url = "{% url 'suggest' %}"
    var search_url = "{% url 'search' %}"


	$('.searchList').on('click', '.searchItem', function(){
		$('.searchList .searchItem').removeClass('current');
		$(this).addClass('current');
	});

    // js数组删除指定的值
    function removeByValue(arr, val) {
      for(var i=0; i<arr.length; i++) {
        if(arr[i] == val) {
          arr.splice(i, 1);
          break;
        }
      }
    }
   

    hideElement($('.dataList'), $('.searchInput'));

</script>
<script type="text/javascript" language="javascript"> 
    document.onkeydown =cdk; 
    function cdk(){ 
    if(event.keyCode==13)
    add_search()
    }
    </script> 
<script>
    var searchArr;
    //定义一个search的，判断浏览器有无数据存储（搜索历史）
    if(localStorage.search){
    //如果有，转换成 数组的形式存放到searchArr的数组里（localStorage以字符串的形式存储，所以要把它转换成数组的形式）
        searchArr= localStorage.search.split(",")
    }else{
    //如果没有，则定义searchArr为一个空的数组
        searchArr = [];
    }
    //把存储的数据显示出来作为搜索历史
    MapSearchArr();

    function add_search(){
        var val = $(".searchInput").val();
        if (val.length>=2){
            //点击搜索按钮时，去重
            KillRepeat(val);
            //去重后把数组存储到浏览器localStorage
            localStorage.search = searchArr;
            //然后再把搜索内容显示出来
            MapSearchArr();
        }

        window.location.href=search_url+'?q='+val+"&s_type="+$(".searchItem.current").attr('data-type')

    }
    

    function MapSearchArr(){
        var tmpHtml = "";
        var arrLen = 0
        if (searchArr.length >= 5){
            arrLen = 5
        }else {
            arrLen = searchArr.length
        }
        for (var i=0;i<arrLen;i++){
            tmpHtml += '<a href="'+search_url+'?q='+searchArr[i]+"&s_type="+$(".searchItem.current").attr('data-type')+'">'+searchArr[i]+'</a>'
        }
        $(".mysearch .all-search").html(tmpHtml);
    }

    //去重
    function KillRepeat(val){
        var kill = 0;
        for (var i=0;i<searchArr.length;i++){
            if(val===searchArr[i]){
                kill ++;
            }
        }
        if(kill<1){
            searchArr.unshift(val);
        }else {
            removeByValue(searchArr, val)
            searchArr.unshift(val)
        }
    }


</script>

<script type="text/javascript" language="javascript">
document.onkeydown =cdk;
function cdk(){
if(event.keyCode==13)
add_search()
}
</script>

</html>